let main = document.querySelector(".main");
let icon = document.querySelector(".icon");
let cntSpan = document.querySelector(".cnt");
let cnt = 0;
main.addEventListener("dblclick", (event) => {
  cnt++;
  cntSpan.textContent = cnt;
  icon.style.display = "block";
  icon.style.left = event.offsetX - 25 + "px";
  icon.style.top = event.offsetY - 25 + "px";
  icon.classList.add("animate");
  icon.addEventListener(
    "animationend",
    function () {
      icon.classList.remove("animate");
      icon.style.display = "none";
    },
    { once: true }
  );
});

icon.style.fontSize = "50px";
